import React, { Component } from 'react'
import { BrowserRouter as Router, Route } from 'react-router-dom'
import routes from './config'
export default class RootRoutes extends Component {
    render() {
        return (
            <Router>
                {
                    routes.map((route, index) =>
                        <Route
                            key={index}
                            exact={route.exact}
                            path={route.path}
                            render={props => <route.component {...props} routes={route.child} />}
                        />
                    )
                }
            </Router>
        )
    }
}
    